<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>给指定调色板索引设定颜色</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.imagecolorresolvealpha.html">« imagecolorresolvealpha</a></li>
      <li style="float: right;"><a href="function.imagecolorsforindex.html">imagecolorsforindex »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.image.html">GD 和图像处理 函数</a></li>
    <li>给指定调色板索引设定颜色</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.imagecolorset" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagecolorset</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imagecolorset</span> &mdash; <span class="dc-title">给指定调色板索引设定颜色</span></p>

 </div>
 <div class="refsect1 unknown-seealsp" id="refsect1-function.imagecolorset-unknown-seealsp">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagecolorset</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">resource</span> <code class="parameter">$image</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$index</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$red</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$green</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$blue</code></span><br>): <span class="type"><span class="type void">void</span></span></div>

  <p class="para rdfs-comment">
   本函数将调色板中指定的索引设定为指定的颜色。对于在调色板图像中创建类似区域填充（flood-fill）的效果很有用，免去了真的去填充的开销。
  </p>
  <p class="para">
   参见 <span class="function"><a href="function.imagecolorat.html" class="function">imagecolorat()</a></span>。
  </p>
 </div>

</div></div></div></body></html>